<?php
  require_once './src/LoginClass.php';
  
  $login = new LoginClass();
  
  if ($login->getUserId() <> 0) {
    echo "<script>location.replace('index.php');</script>";
  } else {
    echo "<script>location.replace('" . $login->getLoginUrl() . "');</script>";
  }
?>